<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>BonoboGenericFactory</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="Libbonobo Reference Manual">
<link rel="up" href="factories.html" title="Objects, Factories, Reference Counting">
<link rel="prev" href="libbonobo-bonobo-object.html" title="BonoboObject">
<link rel="next" href="libbonobo-bonobo-shlib-factory.html" title="bonobo-shlib-factory">
<meta name="generator" content="GTK-Doc V1.15.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="libbonobo-bonobo-object.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="factories.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Libbonobo Reference Manual</th>
<td><a accesskey="n" href="libbonobo-bonobo-shlib-factory.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libbonobo-bonobo-generic-factory.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#libbonobo-bonobo-generic-factory.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="libbonobo-bonobo-generic-factory"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libbonobo-bonobo-generic-factory.top_of_page"></a>BonoboGenericFactory</span></h2>
<p>BonoboGenericFactory — The basic, generic Bonobo object factory implementation</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="libbonobo-bonobo-generic-factory.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis"><a class="link" href="libbonobo-bonobo-object.html#BonoboObject"><span class="returnvalue">BonoboObject</span></a> *      (<a class="link" href="libbonobo-bonobo-generic-factory.html#BonoboFactoryCallback" title="BonoboFactoryCallback ()">*BonoboFactoryCallback</a>)            (<em class="parameter"><code><span class="type">BonoboGenericFactory</span> *factory</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *component_id</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> closure</code></em>);
<span class="returnvalue">BonoboGenericFactory</span> * <a class="link" href="libbonobo-bonobo-generic-factory.html#bonobo-generic-factory-new" title="bonobo_generic_factory_new ()">bonobo_generic_factory_new</a>       (<em class="parameter"><code>const <span class="type">char</span> *act_iid</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libbonobo-bonobo-generic-factory.html#BonoboFactoryCallback" title="BonoboFactoryCallback ()"><span class="type">BonoboFactoryCallback</span></a> factory_cb</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
<span class="returnvalue">BonoboGenericFactory</span> * <a class="link" href="libbonobo-bonobo-generic-factory.html#bonobo-generic-factory-new-closure" title="bonobo_generic_factory_new_closure ()">bonobo_generic_factory_new_closure</a>
                                                        (<em class="parameter"><code>const <span class="type">char</span> *act_iid</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> *factory_closure</code></em>);
<span class="returnvalue">BonoboGenericFactory</span> * <a class="link" href="libbonobo-bonobo-generic-factory.html#bonobo-generic-factory-construct" title="bonobo_generic_factory_construct ()">bonobo_generic_factory_construct</a> (<em class="parameter"><code><span class="type">BonoboGenericFactory</span> *factory</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *act_iid</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> *factory_closure</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="libbonobo-bonobo-generic-factory.html#bonobo-generic-factory-construct-noreg" title="bonobo_generic_factory_construct_noreg ()">bonobo_generic_factory_construct_noreg</a>
                                                        (<em class="parameter"><code><span class="type">BonoboGenericFactory</span> *factory</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *act_iid</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> *factory_closure</code></em>);
<span class="returnvalue">int</span>                 <a class="link" href="libbonobo-bonobo-generic-factory.html#bonobo-generic-factory-main" title="bonobo_generic_factory_main ()">bonobo_generic_factory_main</a>         (<em class="parameter"><code>const <span class="type">char</span> *act_iid</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libbonobo-bonobo-generic-factory.html#BonoboFactoryCallback" title="BonoboFactoryCallback ()"><span class="type">BonoboFactoryCallback</span></a> factory_cb</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
<span class="returnvalue">int</span>                 <a class="link" href="libbonobo-bonobo-generic-factory.html#bonobo-generic-factory-main-timeout" title="bonobo_generic_factory_main_timeout ()">bonobo_generic_factory_main_timeout</a> (<em class="parameter"><code>const <span class="type">char</span> *act_iid</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libbonobo-bonobo-generic-factory.html#BonoboFactoryCallback" title="BonoboFactoryCallback ()"><span class="type">BonoboFactoryCallback</span></a> factory_cb</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> quit_timeout</code></em>);
#define             <a class="link" href="libbonobo-bonobo-generic-factory.html#BONOBO-FACTORY-INIT:CAPS" title="BONOBO_FACTORY_INIT()">BONOBO_FACTORY_INIT</a>                 (descr,
                                                         version,
                                                         argcp,
                                                         argv)
#define             <a class="link" href="libbonobo-bonobo-generic-factory.html#BONOBO-OAF-FACTORY:CAPS" title="BONOBO_OAF_FACTORY()">BONOBO_OAF_FACTORY</a>                  (oafiid,
                                                         descr,
                                                         version,
                                                         callback,
                                                         data)
#define             <a class="link" href="libbonobo-bonobo-generic-factory.html#BONOBO-OAF-FACTORY-MULTI:CAPS" title="BONOBO_OAF_FACTORY_MULTI()">BONOBO_OAF_FACTORY_MULTI</a>            (oafiid,
                                                         descr,
                                                         version,
                                                         callback,
                                                         data)
#define             <a class="link" href="libbonobo-bonobo-generic-factory.html#BONOBO-ACTIVATION-FACTORY:CAPS" title="BONOBO_ACTIVATION_FACTORY()">BONOBO_ACTIVATION_FACTORY</a>           (oafiid,
                                                         descr,
                                                         version,
                                                         callback,
                                                         data)
#define             <a class="link" href="libbonobo-bonobo-generic-factory.html#BONOBO-ACTIVATION-FACTORY-TIMEOUT:CAPS" title="BONOBO_ACTIVATION_FACTORY_TIMEOUT()">BONOBO_ACTIVATION_FACTORY_TIMEOUT</a>   (oafiid,
                                                         descr,
                                                         version,
                                                         callback,
                                                         data,
                                                         quit_timeout)
</pre>
</div>
<div class="refsect1">
<a name="libbonobo-bonobo-generic-factory.description"></a><h2>Description</h2>
<p>
The vast majority of Bonobo objects are created by the
<span class="type">BonoboGenericFactory</span> implementation. This provides a
very simple C sugar wrapper of the GNOME::ObjectFactory
IDL interface, used by OAF to instantiate new objects.
</p>
<p>
Most applications when they start up will register their
Bonobo object factory with OAF, this can be done like this:
  </p>
<div class="example">
<a name="id3092730"></a><p class="title"><b>Example 7. How to register a factory with OAF</b></p>
<div class="example-contents">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="usertype">BonoboGenericFactory</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">factory</span><span class="symbol">;</span>
<span class="normal">factory </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="libbonobo-bonobo-generic-factory.html#bonobo-generic-factory-new">bonobo_generic_factory_new</a></span><span class="normal"> </span><span class="symbol">(</span>
<span class="normal">    </span><span class="string">"OAFIID:GNOME_MyApp_myId"</span><span class="symbol">,</span>
<span class="normal">    my_factory_function</span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
<span class="function"><a href="libbonobo-bonobo-context.html#bonobo-running-context-auto-exit-unref">bonobo_running_context_auto_exit_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">BONOBO_OBJECT</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">factory</span><span class="symbol">));</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

</div>
<p><br class="example-break">
  This registers the factory with OAF, associated with your
factory's OAFIID ( as specified in the installed .oaf file ).
The running_context_auto_exit_unref function is used to ensure
that the program exits the gtk main loop when all of the factory's
( or any derived ) objects are destroyed.
</p>
<p>
When an object that is created by your factory is demanded from
OAF the my_factory_function will be called:
  </p>
<div class="example">
<a name="id3092056"></a><p class="title"><b>Example 8. A simple factory</b></p>
<div class="example-contents">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="keyword">static</span><span class="normal"> <a href="libbonobo-bonobo-object.html#BonoboObject">BonoboObject</a> </span><span class="symbol">*</span>
<span class="function">my_factory_fn</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">BonoboGenericFactory</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">this</span><span class="symbol">,</span>
<span class="normal">               </span><span class="keyword">const</span><span class="normal"> </span><span class="type">char</span><span class="normal">           </span><span class="symbol">*</span><span class="normal">object_id</span><span class="symbol">,</span>
<span class="normal">               </span><span class="type">void</span><span class="normal">                 </span><span class="symbol">*</span><span class="normal">data</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">    </span><span class="usertype">BonoboObject</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">object </span><span class="symbol">=</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">;</span>
<span class="normal">    </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Warnings-and-Assertions.html#g-return-val-if-fail">g_return_val_if_fail</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">object_id </span><span class="symbol">!=</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
<span class="normal">    </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(!</span><span class="function">strcmp</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">object_id</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"OAFIID:Bonobo_Sample_Clock"</span><span class="symbol">))</span>
<span class="normal">        object </span><span class="symbol">=</span><span class="normal"> </span><span class="function">bonobo_clock_control_new</span><span class="normal"> </span><span class="symbol">();</span>
<span class="normal">    </span><span class="keyword">else</span>
<span class="normal">        </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Message-Logging.html#g-warning">g_warning</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Unknown OAFIID '%s'"</span><span class="symbol">,</span><span class="normal"> object_id</span><span class="symbol">);</span>
<span class="normal">    </span><span class="keyword">return</span><span class="normal"> object</span><span class="symbol">;</span>
<span class="cbracket">}</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

</div>
<p><br class="example-break">
  This will return the newly constructed object via OAF to
the Object requestor.
</p>
<p>
There is a macro that can be used for simple components to remove the
burden of writing the main function and getting the initialization
correct, see <a class="link" href="libbonobo-bonobo-generic-factory.html#BONOBO-ACTIVATION-FACTORY:CAPS" title="BONOBO_ACTIVATION_FACTORY()"><span class="type">BONOBO_ACTIVATION_FACTORY</span></a>.  </p>
</div>
<div class="refsect1">
<a name="libbonobo-bonobo-generic-factory.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="BonoboFactoryCallback"></a><h3>BonoboFactoryCallback ()</h3>
<pre class="programlisting"><a class="link" href="libbonobo-bonobo-object.html#BonoboObject"><span class="returnvalue">BonoboObject</span></a> *      (*BonoboFactoryCallback)            (<em class="parameter"><code><span class="type">BonoboGenericFactory</span> *factory</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *component_id</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> closure</code></em>);</pre>
<p>
Type of function that is called when it's time for the factory to create a new instance.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>factory</code></em> :</span></p></td>
<td>the factory that invoked this callback
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>component_id</code></em> :</span></p></td>
<td>OAFIID of the component that should be activated
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>closure</code></em> :</span></p></td>
<td>user data
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the newly created <a class="link" href="libbonobo-bonobo-object.html#BonoboObject"><span class="type">BonoboObject</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-generic-factory-new"></a><h3>bonobo_generic_factory_new ()</h3>
<pre class="programlisting"><span class="returnvalue">BonoboGenericFactory</span> * bonobo_generic_factory_new       (<em class="parameter"><code>const <span class="type">char</span> *act_iid</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libbonobo-bonobo-generic-factory.html#BonoboFactoryCallback" title="BonoboFactoryCallback ()"><span class="type">BonoboFactoryCallback</span></a> factory_cb</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
This is a helper routine that simplifies the creation of factory
objects for GNOME objects.  The <em class="parameter"><code>factory</code></em> function will be
invoked by the CORBA server when a request arrives to create a new
instance of an object supporting the Bonobo::Generic interface.
The factory callback routine is passed the <em class="parameter"><code>data</code></em> pointer to provide
the creation function with some state information.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>act_iid</code></em> :</span></p></td>
<td>The GOAD id that this factory implements
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>factory_cb</code></em> :</span></p></td>
<td>A callback which is used to create new BonoboObject instances.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>The closure data to be passed to the <em class="parameter"><code>factory</code></em> callback routine.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A BonoboGenericFactory object that has an activated
Bonobo::GenericFactory object that has registered with the GNOME
name server.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-generic-factory-new-closure"></a><h3>bonobo_generic_factory_new_closure ()</h3>
<pre class="programlisting"><span class="returnvalue">BonoboGenericFactory</span> * bonobo_generic_factory_new_closure
                                                        (<em class="parameter"><code>const <span class="type">char</span> *act_iid</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> *factory_closure</code></em>);</pre>
<p>
This is a helper routine that simplifies the creation of factory
objects for GNOME objects.  The <em class="parameter"><code>factory_closure</code></em> closure will be
invoked by the CORBA server when a request arrives to create a new
instance of an object supporting the Bonobo::Generic interface.
The factory callback routine is passed the <em class="parameter"><code>data</code></em> pointer to provide
the creation function with some state information.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>act_iid</code></em> :</span></p></td>
<td>The GOAD id that this factory implements
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>factory_closure</code></em> :</span></p></td>
<td>A closure which is used to create new BonoboObject instances.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A BonoboGenericFactory object that has an activated
Bonobo::GenericFactory object that has registered with the GNOME
name server.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-generic-factory-construct"></a><h3>bonobo_generic_factory_construct ()</h3>
<pre class="programlisting"><span class="returnvalue">BonoboGenericFactory</span> * bonobo_generic_factory_construct (<em class="parameter"><code><span class="type">BonoboGenericFactory</span> *factory</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *act_iid</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> *factory_closure</code></em>);</pre>
<p>
Initializes <em class="parameter"><code>c_factory</code></em> with and registers the new factory with
the name server.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>factory</code></em> :</span></p></td>
<td>The object to be initialized.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>act_iid</code></em> :</span></p></td>
<td>The Bonobo activation id that the new factory will implement.
Bonobo::GenericFactory interface and which will be used to
construct this BonoboGenericFactory Gtk object.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>factory_closure</code></em> :</span></p></td>
<td>A Multi object factory closure.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The initialized BonoboGenericFactory object or NULL
         if already registered.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-generic-factory-construct-noreg"></a><h3>bonobo_generic_factory_construct_noreg ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                bonobo_generic_factory_construct_noreg
                                                        (<em class="parameter"><code><span class="type">BonoboGenericFactory</span> *factory</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *act_iid</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> *factory_closure</code></em>);</pre>
<p>
Initializes <em class="parameter"><code>c_factory</code></em> with the supplied closure and iid.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>factory</code></em> :</span></p></td>
<td>The object to be initialized.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>act_iid</code></em> :</span></p></td>
<td>The GOAD id that the new factory will implement.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>factory_closure</code></em> :</span></p></td>
<td>A Multi object factory closure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-generic-factory-main"></a><h3>bonobo_generic_factory_main ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>                 bonobo_generic_factory_main         (<em class="parameter"><code>const <span class="type">char</span> *act_iid</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libbonobo-bonobo-generic-factory.html#BonoboFactoryCallback" title="BonoboFactoryCallback ()"><span class="type">BonoboFactoryCallback</span></a> factory_cb</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
A Generic 'main' routine so we don't stick a load of code
inside a public macro. See also <a class="link" href="libbonobo-bonobo-generic-factory.html#bonobo-generic-factory-main-timeout" title="bonobo_generic_factory_main_timeout ()"><code class="function">bonobo_generic_factory_main_timeout()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>act_iid</code></em> :</span></p></td>
<td>the oaf iid of the factory
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>factory_cb</code></em> :</span></p></td>
<td>the factory callback
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>a user data pointer
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> 0 on success, 1 on failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-generic-factory-main-timeout"></a><h3>bonobo_generic_factory_main_timeout ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>                 bonobo_generic_factory_main_timeout (<em class="parameter"><code>const <span class="type">char</span> *act_iid</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libbonobo-bonobo-generic-factory.html#BonoboFactoryCallback" title="BonoboFactoryCallback ()"><span class="type">BonoboFactoryCallback</span></a> factory_cb</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> quit_timeout</code></em>);</pre>
<p>
A Generic 'main' routine so we don't stick a load of code
inside a public macro.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>act_iid</code></em> :</span></p></td>
<td>the oaf iid of the factory
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>factory_cb</code></em> :</span></p></td>
<td>the factory callback
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>a user data pointer
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>quit_timeout</code></em> :</span></p></td>
<td>ammount of time to wait (miliseconds) after all
objects have been released before quitting the main loop.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> 0 on success, 1 on failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="BONOBO-FACTORY-INIT:CAPS"></a><h3>BONOBO_FACTORY_INIT()</h3>
<pre class="programlisting">#define             BONOBO_FACTORY_INIT(descr, version, argcp, argv)</pre>
<p>
Macro that expands to the code need to initialize an exe factory.  Should be placed at the beginning of the <code class="function">main()</code> function.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>descr</code></em> :</span></p></td>
<td>factory description string
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>version</code></em> :</span></p></td>
<td>version string
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>argcp</code></em> :</span></p></td>
<td>pointer to <code class="function">main()</code>'s argc
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>argv</code></em> :</span></p></td>
<td>main()'s argv
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="BONOBO-OAF-FACTORY:CAPS"></a><h3>BONOBO_OAF_FACTORY()</h3>
<pre class="programlisting">#define             BONOBO_OAF_FACTORY(oafiid, descr, version, callback, data)</pre>
<p>
Deprecated; see <a class="link" href="libbonobo-bonobo-generic-factory.html#BONOBO-ACTIVATION-FACTORY:CAPS" title="BONOBO_ACTIVATION_FACTORY()"><code class="function">BONOBO_ACTIVATION_FACTORY()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>oafiid</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>descr</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>version</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="BONOBO-OAF-FACTORY-MULTI:CAPS"></a><h3>BONOBO_OAF_FACTORY_MULTI()</h3>
<pre class="programlisting">#define             BONOBO_OAF_FACTORY_MULTI(oafiid, descr, version, callback, data)</pre>
<p>
Deprecated; see <a class="link" href="libbonobo-bonobo-generic-factory.html#BONOBO-ACTIVATION-FACTORY:CAPS" title="BONOBO_ACTIVATION_FACTORY()"><code class="function">BONOBO_ACTIVATION_FACTORY()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>oafiid</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>descr</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>version</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="BONOBO-ACTIVATION-FACTORY:CAPS"></a><h3>BONOBO_ACTIVATION_FACTORY()</h3>
<pre class="programlisting">#define             BONOBO_ACTIVATION_FACTORY(oafiid, descr, version, callback, data)</pre>
<p>
    Macro that includes all boiler-plate code necessary to create an exe
    type factory, including a <code class="function">main()</code> function and a generic factory.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>oafiid</code></em> :</span></p></td>
<td>The factory's OAFIID
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>descr</code></em> :</span></p></td>
<td>Description of the factory
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>version</code></em> :</span></p></td>
<td>Version string of the factory program
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
<td>Function (<a class="link" href="libbonobo-bonobo-generic-factory.html#BonoboFactoryCallback" title="BonoboFactoryCallback ()"><span class="type">BonoboFactoryCallback</span></a>) responsible for intantiating components
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>Additional data to be passed to the callback
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="BONOBO-ACTIVATION-FACTORY-TIMEOUT:CAPS"></a><h3>BONOBO_ACTIVATION_FACTORY_TIMEOUT()</h3>
<pre class="programlisting">#define             BONOBO_ACTIVATION_FACTORY_TIMEOUT(oafiid, descr, version, callback, data, quit_timeout)</pre>
<p>
    Like <a class="link" href="libbonobo-bonobo-generic-factory.html#BONOBO-ACTIVATION-FACTORY:CAPS" title="BONOBO_ACTIVATION_FACTORY()"><code class="function">BONOBO_ACTIVATION_FACTORY()</code></a>, but has an extra <em class="parameter"><code>quit_timeout</code></em> argument.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>oafiid</code></em> :</span></p></td>
<td>The factory's OAFIID
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>descr</code></em> :</span></p></td>
<td>Description of the factory
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>version</code></em> :</span></p></td>
<td>Version string of the factory program
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
<td>Function (<a class="link" href="libbonobo-bonobo-generic-factory.html#BonoboFactoryCallback" title="BonoboFactoryCallback ()"><span class="type">BonoboFactoryCallback</span></a>) responsible for intantiating components
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>Additional data to be passed to the callback
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>quit_timeout</code></em> :</span></p></td>
<td>Ammount of time to wait (in milliseconds) before deciding to quit the factory.  A larger value prevents frequent respawning of a new factory process when there are many consecutive one-time requests, so that your factory appears to start faster after the first time.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.15.1</div>
</body>
</html>